<template>
	<view>
		<view class="box">
			<view class="conter">
				<view class="top">
					<view class="topz">
						<view style="display: flex; align-items: center;">
							<view style="font-size: 56upx;font-weight: bold;">{{list.company_name}}</view>
							<image src="../../../static/gsrz.png" style="width: 40rpx; height: 40rpx; margin-left: 12rpx;"></image>
						</view>
						<view class="zi">
							<text>{{ list.city_name }}&nbsp;&nbsp;|&nbsp;&nbsp;{{list.scale_type_type_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{list.industry}}</text>
						</view>
					</view>
					<view class="topy" style="font-size: 35rpx;font-weight: bold;color: #3291F8;">
						<image :src="list.logo" style="width: 108rpx;height: 108rpx;border-radius: 8rpx;" mode=""></image>
					</view>
				</view>

				<view class="describe">
					<view class="">
						<view class="" style="font-size: 40rpx;font-weight: bold;margin-bottom: 40rpx;">
							公司介绍
						</view>
						<view class="describeWord">
							<mote-lines-divide :dt="list.introduce" :line="3" />
						</view>
					</view>
				</view>

				<view class="describe">
					<view class="" style="font-size: 40rpx; font-weight: bold; margin-bottom: 38rpx;">公司照片</view>
					<scroll-view scroll-x="true" class="bookshelf-content">
						<block>
							<image v-for="(pic,i) in list.company_pic" :key="i" :src="pic" mode="heightFix" @tap="previewImg(i)"></image>
							<!-- <image :src="list.company_pic" mode="heightFix" @tap="previewImg"></image> -->
						</block>
					</scroll-view>
				</view>
				
				<view class="gs-address">
					<view class="gs-tit">公司地址</view>
					<map style="width: 696upx; height: 342upx;" :latitude="latitude" :longitude="longitude" :markers="covers"></map>
					<view class="icon-tit">广州市-番禺区-市桥街</view>
				</view>
				
				<view class="zw-head">在招职位</view>
				<view class="zw-box" v-for="item,i in zhiwList" :key="i" @click="zhiweiClick(item.id)">
					<view class="zw-box-head">
						<view class="zw-box-head-l">{{ item.job_type_name }}</view>
						<view class="zw-box-head-r">{{ item.salary_range_type_name }}</view>
					</view>
					<view class="zw-box-ct-top">
						<view>广州&nbsp;&nbsp;|&nbsp;&nbsp;{{ item.work_experience_type_name }}&nbsp;&nbsp;|&nbsp;&nbsp;{{ item.edu_type_name }}</view>
					</view>
					<view class="zw-box-ct-bot">
						<view class="zw-item-box">{{ item.treatment_type_name }}</view>
					</view>
					<view class="zw-box-bot">
						<image src="@/static/logo.png"></image>
						<view class="zw-box-bot-r">
							<view style="font-size: 32upx; color: #101010;">{{ item.department_type_name }}</view>
							<view style="font-size: 26upx; color: #7B7B7B;">{{list.scale_type_type_name}}</view>
						</view>
					</view>
					<view class="bot-line"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import MoteLinesDivide from "@/components/mote-lines-divide/mote-lines-divide.vue"
	export default {
		components:{
			MoteLinesDivide
		},
		data() {
			return {
				url: '',
				id: '',
				identity: '',
				list: {
					company: {
						logo: ''
					}
				},
				id:0, // 使用 marker点击事件 需要填写id
				latitude: 22.94,
				longitude: 113.36,
				covers: [
					{
						latitude: 22.94,
						longitude: 113.36,
						iconPath: '../../../static/gs-address.png'
					}
				],
				zhiwList:[],
				form:{},
			}
		},
		onLoad(e) {
			console.log(e)
			this.id = e.id;
			this.identity = e.identity;
			if (e.identity == 0) {
				this.url = '/Index/Index/get_company_info_by_id'
			} else if (e.identity == 1) {
				this.url = '/Index/UserCompany/get_user_company';
			}
			this.details()
			this.getData()
		},
		methods: {
			async details() {
				const res = await this.post(this.url, {id: this.id})
				this.list = res.data
				this.list.company_pic=this.list.company_pic.split(',')
			},
			async getData() {
				const res = await this.get('/Index/Index/get_company_job_list_by_company_id',{id:this.id})
				if(res.code == 200){
					this.zhiwList = res.data
				}
			},
			zhiweiClick(id){
				uni.navigateTo({
					url:'./details?id='+id+'&identity=0'
				})
			},
			previewImg(i){
				uni.previewImage({
					urls: this.list.company_pic,
					current: i
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bookshelf-content {
		white-space: nowrap; // 滚动必须加的属性
		margin-bottom: 88upx;
		image {
			width: 364upx;
			height: 200upx;
			margin-right: 30upx;
		}
	}
	.company {
		.company_information {
			display: flex;
			align-items: center;
			justify-content: space-between;
			.topz {
				.zi {
					font-size: 20rpx;
					margin: 15rpx 0;

					text {
						margin-right: 10rpx;
					}
				}

				.xq {
					text {
						background-color: #C8C7CC;
						margin-right: 10rpx;
						padding: 2px 10rpx;
					}
				}
			}
		}

		.address {
			view {
				font-size: 26rpx;
				margin: 10rpx 0;

				&:nth-child(2) {
					font-size: 20rpx;
					color: #adacaf;
				}
			}
		}
	}

	.describe {
		margin-top: 50rpx;
		.describeWord {
			font-size: 30rpx;
			margin: 10rpx 0 98rpx 0;
		}
	}
	.box {
		padding: 30rpx;
		box-sizing: border-box;

		.conter {
			margin: 20rpx 0;
			.top {
				display: flex;
				align-items: center;
				justify-content: space-between;
				.topz {
					.zi {
						color: #999999;
						margin: 15rpx 0;
						font-size: 24rpx;
						text {
							margin-right: 10rpx;
						}
					}

					.xq {
						text {
							background-color: #C8C7CC;
							margin-right: 10rpx;
							padding: 2px 10rpx;
						}
					}
				}
			}

			.bottom {
				margin: 50rpx 0 100rpx 0;
				border-top: 1rpx solid #C8C7CC;
				border-bottom: 1rpx solid #C8C7CC;
				padding: 20rpx 0;

				.zi {
					text {
						margin-right: 10rpx;
						font-size: 20rpx;
					}
				}
			}
		}
	}
	.gs-address{
		.gs-tit{
			font-weight: bold;
			font-size: 40upx;
			margin: 0 0 38upx 4upx;
		}
		.icon-tit{
			display: flex;
			align-items: center;
			width: 638upx;
			height: 80upx;
			background: #FFFFFF;
			position: relative;
			bottom: 290upx;
			left: 50upx;
			padding-left: 34upx;
		}
	}
	.zw-head{
		font-size: 40upx;
		font-weight: bold;
		margin: 0 0 46upx 4upx;
	}
	.zw-box{
		.zw-box-head{
			display: flex;
			margin-top: 30upx;
			justify-content: space-between;
			.zw-box-head-l{
				color: #101010;
				font-size: 32upx;
				font-weight: bold;
			}
			.zw-box-head-r{
				color: #3291F8;
				font-size: 32upx;
				font-weight: bold;
			}
		}
		.zw-box-ct-top{
			color: #7B7B7B;
			font-size: 26upx;
			margin: 20upx 0;
		}
		.zw-box-ct-bot{
			display: flex;
			.zw-item-box{
				display: flex;
				align-items: center;
				justify-content: center;
				width: 122upx;
				height: 40upx;
				color: #7f7f7f;
				font-size: 24upx;
				background: #E7E7E7;
				margin-right: 12upx;
			}
		}
		.zw-box-bot{
			display: flex;
			
			margin: 40upx 0;
			image{
				width: 88upx;
				height: 88upx;
				border-radius: 10upx;
				margin-right: 14upx;
			}
		}
		.bot-line{
			width: 750upx;
			height: 20upx;
			background: #F6F6F6;
		}
	}
</style>
